package cn.ywsj.ywsjmidtier.service;


import cn.ywsj.ywsjmidtier.common.Connect;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Api(tags = "用户信息")
@FeignClient(url = Connect.XSX_URL,name = "xsx")
public interface WechatUserInfoFeign {

    /**
     * 用户信息
     * @return
     */
    @ApiOperation("用户信息")
    @PostMapping("/wechat/member/account/getuserinfo")
    String getUserInfo();

    /**
     * 修改密码
     * @param jsonObject
     * @param result
     * @param request
     * @param attr
     * @return
     */
    @ApiOperation("修改密码")
    @PostMapping("/wechat/member/account/ajaxmodifypasswd")
    String modifyPassword(@RequestParam("jsonObject") JSONObject jsonObject, @RequestParam("result") BindingResult result, @RequestParam("request") HttpServletRequest request, @RequestParam("attr") RedirectAttributes attr);

    /**
     * 忘记支付密码
     * @param jsonObject
     * @param result
     * @return
     */
    @ApiOperation("忘记支付密码")
    @PostMapping("/wechat/member/account/ajaxmodifypaypasswdforget")
    String modifyPayPasswordForget(@RequestParam("jsonObject") JSONObject jsonObject,@RequestParam("result") BindingResult result);

    /**
     * 我的供应商_供应商列表
     * @param jsonObject
     * @param start
     * @param pageSize
     * @return
     */
    @ApiOperation("我的供应商_供应商列表")
    @PostMapping("/wechat/member/account/getsupcustnamelist")
    String getSupCustNameList(@RequestParam("jsonObject")JSONObject jsonObject,@RequestParam("start")Integer start,@RequestParam("pageSize")Integer pageSize);

    @PostMapping(value = {"/wechat/member/account/ajaxmodifypaymentpasswd"})
    String modifyPayPassword(@RequestParam("jsonObject") JSONObject jsonObject,@RequestParam("result")  BindingResult result);

    @GetMapping(value = {"/wechat/member/account/spreadcenter"})
    String spreadCenter();

    @RequestMapping({"/wechat/member/account/updateuserinfo"})
    String updateUserInfo(@RequestParam("jsonObject") JSONObject jsonObject);

    @PostMapping(value = {"/wechat/member/account/ajaxmodifypaypasswdforapp"})
    String modifyPayPasswordForApp(@RequestParam("jsonObject") JSONObject jsonObject,@RequestParam("result")  BindingResult result);

    @RequestMapping({"/wechat/member/account/modifyuserinfo"})
    String modifyUserInfo(@RequestParam("jsonObject") JSONObject jsonObject);

    @RequestMapping({"/wechat/member/account/getusercode"})
    String getQRImage(@RequestParam("userId") Long userId);

    @PostMapping(value = {"/wechat/member/account/verificationtel"})
    String verificationTel(@RequestParam("smsAuth")String smsAuth, @RequestParam("session")HttpSession session);

    @PostMapping(value = {"/wechat/member/account/modifytel"})
    String modifyTel(@RequestParam("jsonObject") JSONObject jsonObject,@RequestParam("session") HttpSession session);
}
